package com.songhuan.web.controller;
import com.songhuan.web.dto.*;
import com.songhuan.web.dto.query.*;
import com.songhuan.web.entity.*;
import com.songhuan.web.mapper.*;
import com.songhuan.web.service.*;
import com.songhuan.web.tools.dto.*;
import com.songhuan.web.dto.ReCheckDto;
import com.songhuan.web.dto.query.ReCheckPagedInput;
import com.songhuan.web.mapper.ReCheckMapper;
import com.songhuan.web.service.ReCheckService;
import com.songhuan.web.tools.dto.IdInput;
import com.songhuan.web.tools.dto.IdsInput;
import com.songhuan.web.tools.dto.PagedResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import lombok.SneakyThrows;

/**
 * 补卡记录控制器
 */
@RestController()
@RequestMapping("/ReCheck")
public class ReCheckController {
    @Autowired()
    private ReCheckService _ReCheckService;
    @Autowired()
    private ReCheckMapper _ReCheckMapper;
    /**
     * 补卡记录分页查询
     */
    @RequestMapping(value = "/List", method = RequestMethod.POST)
    @SneakyThrows
    public PagedResult<ReCheckDto> List(@RequestBody ReCheckPagedInput input)  {
        return _ReCheckService.List(input);
    }
     /**
     * 单个补卡记录查询接口
     */
    @RequestMapping(value = "/Get", method = RequestMethod.POST)
    @SneakyThrows
    public ReCheckDto Get(@RequestBody ReCheckPagedInput input) {

        return _ReCheckService.Get(input);
    }
  
    /**
     * 补卡记录创建或则修改
     */
    @RequestMapping(value = "/CreateOrEdit", method = RequestMethod.POST)
    public ReCheckDto CreateOrEdit(@RequestBody ReCheckDto input) throws Exception {
        return _ReCheckService.CreateOrEdit(input);
    }
    /**
     * 补卡记录删除
     */
    @RequestMapping(value = "/Delete", method = RequestMethod.POST)
    public void Delete(@RequestBody IdInput input)
    {
        _ReCheckService.removeById(input.getId());
    }

    /**
     * 补卡记录批量删除
     */
    @RequestMapping(value = "/BatchDelete", method = RequestMethod.POST)
    public void BatchDelete(@RequestBody IdsInput input)
    {
        _ReCheckService.removeByIds(input.getIds());
    }

    /**
     * 补卡申请
     * @param input
     */
    @RequestMapping(value = "/Apply", method = RequestMethod.POST)
    public void Apply(@RequestBody ReCheckDto input) {
        _ReCheckService.Apply(input);
    }

    /**
     * 补卡通过
     * @param input
     */
    @RequestMapping(value = "/ApplySuccess", method = RequestMethod.POST)
    public void ApplySuccess(@RequestBody ReCheckDto input) {
        _ReCheckService.ApplySuccess(input);
    }


}
